<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <script src="./vue.js"></script>
    </head>
    <style>
        
    </style>
    <body>
        <div id="app">
            <cpn1></cpn1>
            <cpn2></cpn2>
        </div>
    </body>
    <script>
        // 全局组件注册的语法糖
        Vue.component('cpn1',{
            template:`
                <div>
                    <h2>我是标题111</h2>
                    <p>我是内容,哈哈哈</p>  
                    <p>我是内容,呵呵呵</p>  
                </div>
            `
        })
        
        let app = new Vue({
            el:"#app",
            components: {
                // 局部组件 语法糖
                'cpn2':{
                    template:`
                        <div>
                            <h2>我是标题222</h2>
                            <p>我是内容,哈哈哈222</p>  
                            <p>我是内容,呵呵呵222</p>
                        </div> 
                    `
                }
            }
        })
    </script>
</html>